<template>
  <div class="realname">
    <van-nav-bar title="实名认证">
      <img
        src="../../assets/image/arrow_left.png"
        width="20"
        height="20"
        slot="left"
        fixed
        @click="leftClick"
      />
    </van-nav-bar>
    <div class="realname-main">
      <img
        src="../../assets/image/img_realname.png"
        alt=""
        width="100%"
        height="200"
      />
      <div class="realname-text">
        <span></span>
        请选择审核方式
      </div>
    </div>
    <div v-for="item in type" :key="item.typeId">
      <img
        v-if="item.typeId === isDisplay.faceRecognition"
        src="../../assets/image/img_realnameo.png"
        alt=""
        width="100%"
        height="160"
      />

      <img
        v-if="item.typeId === isDisplay.artificialRecognition"
        src="../../assets/image/img_realnamet.png"
        alt=""
        width="100%"
        height="160"
        @click="getRealName"
      />
    </div>
  </div>
</template>
<script>
import { querySelectToConfigure } from "network/ApiServe";
export default {
  data() {
    return {
      type: [
        { typeId: 0, name: "不显示" },
        { typeId: 1, name: "显示" },
      ],
      isDisplay: {},
    };
  },
  created() {
    this.brandId = localStorage.getItem("brandId");
  },
  mounted() {
    this.getSelectToConfigure();
  },
  methods: {
    leftClick() {
      this.$router.back(-1);
    },
    // 查询实名配置
    getSelectToConfigure() {
      querySelectToConfigure(this.brandId)
        .then((res) => {
          if (res.resp_code === "000000") {
            this.isDisplay = res.result;
          } else {
            this.$toast(this.res.resp_message);
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    getRealName() {
      this.$router.push("/realnamecertification");
    },
  },
};
</script>
<style scoped>
.realname-text {
  background-color: #fff;
  width: 90%;
  border-radius: 15px;
  margin: 0 auto;
  position: relative;
  top: -18px;
  padding: 0 20px;
  font-size: 16px;
  height: 30px;
  line-height: 30px;
}
span {
  height: 15px;
  width: 2px;
  display: inline-block;
  background-color: red; /* 浏览器不支持时显示 */
  background-image: linear-gradient(#FFB633, #FE7C2E);
  vertical-align: middle;
}
</style>